|
define()
在PHP中,定义常量的函数是define()。12
此函数的语法格式为define(string constant_name, mixed value, case_sensitive = true)。它的必选参数包括constant_name(常量名称)和value(常量的值)。第三个参数case_sensitive是可选的,指定是否大小写敏感,设定为true表示不敏感。此外,还有constant()函数可以获取常量的值,而defined()函数可以用来判断一个常量是否已经定义。23